home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / batch / strings2.zip / SHELL.BAT < prev    next >
DOS Batch File  |  1992-11-05  |  1KB  |  51 lines

  1. @ECHO off
  2. REM ===================================================================
  3. REM
  4. REM Shell out to a new copy of COMMAND.COM to increase environment size
  5. REM
  6. REM ===================================================================
  7.  
  8. REM
  9. REM Determine the bytes free in the current environment.  If there are not
  10. REM 300 bytes free, shell out to increase the size of the environment.
  11. REM
  12.  
  13. STRINGS efree = ENVFREE
  14. STRINGS SUB 300, %EFREE% > NUL
  15. IF ERRORLEVEL 1 GOTO main
  16.  
  17.  
  18. ECHO Bytes free in current environment:
  19. STRINGS ENVFREE
  20.  
  21. REM
  22. REM Determine the size of the necessary environment by adding the
  23. REM required bytes to the current environment size.
  24. REM
  25.  
  26. STRINGS esize = ENVSIZE
  27. STRINGS esize = ADD %ESIZE%, 300
  28.  
  29. REM
  30. REM Shell out using the COMSPEC variable.  The %0 parameter is the name
  31. REM of the batch file being executed.
  32. REM
  33.  
  34. %COMSPEC% /e:%ESIZE% /c %0
  35. GOTO end
  36.  
  37. REM
  38. REM This is the main body of the batch file.  Since this is only an
  39. REM example, the only work done here is to print the number of bytes free
  40. REM in the shelled environment.
  41. REM
  42.  
  43. :MAIN
  44. ECHO.
  45. ECHO Bytes free in shelled environment
  46. STRINGS ENVFREE
  47.  
  48. :END
  49. SET EFREE=
  50. SET ESIZE=
  51.